/*============================================================================*/
/*  Copyright (C) 2009-2014, iSOFT INFRASTRUCTURE SOFTWARE CO.,LTD.
 *  
 *  All rights reserved. This software is iSOFT property. Duplication 
 *  or disclosure without iSOFT written authorization is prohibited.
 *  
 *  @file       <Xcp_Cfg.h>
 *  @brief      <>
 *  
 *  <MCU:TC1782>
 *  
 *  @author     <>
 *  @date       <2015-03-09 14:33:27>
 */
/*============================================================================*/


#ifndef  XCP_CFG_H
#define  XCP_CFG_H

/*=======[R E V I S I O N   H I S T O R Y]====================================*/
/*  <VERSION>    <DATE>    <AUTHOR>     <REVISION LOG>
 *  V1.0.0       20081127  Dongyuan.Sun Initial version
 * 
 */
/*============================================================================*/

/*=======[V E R S I O N  I N F O R M A T I O N]===============================*/
#define XCP_CFG_H_VENDOR_ID  0
#define XCP_CFG_H_MODULE_ID  0
#define XCP_CFG_H_AR_MAJOR_VERSION  4
#define XCP_CFG_H_AR_MINOR_VERSION  0
#define XCP_CFG_H_AR_PATCH_VERSION  3
#define XCP_CFG_H_SW_MAJOR_VERSION  1
#define XCP_CFG_H_SW_MINOR_VERSION  0
#define XCP_CFG_H_SW_PATCH_VERSION  0
#define XCP_CFG_H_VENDOR_API_INFIX  0

/*=======[I N C L U D E S]====================================================*/
/* Bus Interface Select */
#define XCP_ON_CAN_ENABLE           STD_ON
#define XCP_ON_CCD_ENABLE           STD_OFF
#define XCP_ON_ETHERNET_ENABLE      STD_OFF
#define XCP_ON_FLEXRAY_ENABLE       STD_OFF

#include "Xcp_GenericTypes.h"
#include "Os.h"
#if (XCP_ON_CAN_ENABLE == STD_ON) 
#include "XcpOnCan.h"
#endif
#if ((XCP_ON_ETHERNET_ENABLE == STD_ON)||(XCP_ON_CCD_ENABLE == STD_ON))
#include "XcpOnEth.h"
#endif
#if (XCP_ON_FLEXRAY_ENABLE == STD_ON)
#include "XcpOnFr.h"
#endif

/*=======[M A C R O S]========================================================*/

/*
 * System Info.
 */
#define CANAPE_TEST 
 
#define XCP_ADDRESS_GRANULARITY       XCP_AG_BYTE 
#if (XCP_ADDRESS_GRANULARITY == XCP_AG_BYTE)
#define XCP_AG                      (0x01u)
#elif (XCP_ADDRESS_GRANULARITY == XCP_AG_WORD)
#define XCP_AG                      (0x02u)
#elif (XCP_ADDRESS_GRANULARITY == XCP_AG_DWORD)
#define XCP_AG                      (0x04u)
#endif

#define XCP_MAIN_FUNCTION_PERIOD    10u

/* AUTOSAR Function Enable */
#define XCP_VERSION_INFO_API        STD_OFF 
#define XCP_DEV_ERROR_DETECT        STD_OFF 
#define XCP_SUPPRESS_TX_SUPPORTED   STD_OFF 

/* Resource & Protection Enable */
#define XCP_RESOURCE                (0|XCP_PL_DAQ|XCP_PL_CAL)
#define XCP_PROTECTION              (0|XCP_PL_DAQ|XCP_PL_CAL)

/* Optional Feature Enable */ 
/* now the following feature are all not supportted */
#define XCP_CAL_STORE_SUPPORT       STD_OFF
#define XCP_DAQ_STORE_SUPPORT       STD_OFF
#define XCP_RESUME_SUPPORT          STD_OFF
#define XCP_BIT_STIM_SUPPORT        STD_OFF

/* Transport Layer Spec. */
#define XCP_BUS_TX_POLLING_MODE     STD_OFF

#define XCP_TANSFER_TIME_OUT        3u /* advance option default is 3 */

#define XCP_MAX_CTO	                8u
#if (XCP_PL_PGM == (XCP_RESOURCE&XCP_PL_PGM))
#define XCP_MAX_CTO_PGM             8u
#endif /* (XCP_PL_PGM == (XCP_RESOURCE&XCP_PL_PGM)) */
#define XCP_MAX_DTO                 8u

#define XCP_CTO_BUFFER_SIZE         8u  /* max(XCP_MAX_CTO, XCP_MAX_CTO_PGM)*/
#define XCP_DTO_BUFFER_SIZE         8u  /* XCP_MAX_DTO */

/* Transmission Mode Enable */
/* Interleaved Mode */
#define XCP_INTERLEAVED_MODE        STD_OFF /* Not Supported by CAN */
#if (XCP_INTERLEAVED_MODE == STD_ON)
#define XCP_QUEUE_SIZE              8u
    #if (XCP_PL_PGM == (XCP_RESOURCE&XCP_PL_PGM))
    #define XCP_QUEUE_SIZE_PGM          8u
    #endif /* (XCP_PL_PGM == (XCP_RESOURCE&XCP_PL_PGM)) */
#endif /* (XCP_INTERLEAVED_MODE == STD_ON) */
/* Blcok Mode */
#define XCP_SLAVE_BLOCK_MODE         STD_ON 
#define XCP_MASTER_BLOCK_MODE        STD_ON 
#if (XCP_MASTER_BLOCK_MODE == STD_ON)
#define XCP_MAX_BS      8u
#define XCP_MIN_ST      10u          /* Uint 100us */
    #if (XCP_PL_PGM == (XCP_RESOURCE&XCP_PL_PGM))
    #define XCP_MAX_BS_PGM  22u
    #define XCP_MIN_ST_PGM  10u          /* Uint 100us */
    #endif  /* XCP_PL_PGM enable */
#define XCP_BLOCK_BUFFER_SIZE       132u /* max(XCP_MAX_BS,XCP_MAX_BS_PGM)*((XCP_CTO_BUFFER_SIZE - 2)/AG) */
#endif  /* XCP_MASTER_BLOCK_MODE == STD_ON */

#if (XCP_ON_CAN_ENABLE == STD_ON)
#if (XCP_MASTER_BLOCK_MODE == STD_ON)
#define XCP_INCREASED_CAN_ID            STD_ON
#endif
#define XCP_CAN_MAX_DLC_REQUIRED        STD_ON
#define XCP_CAN_MAX_DLC                 0x08u   /* fixed value on CAN */
#endif /* (XCP_ON_CAN_ENABLE == STD_ON) */


/* 
 * CAL Related
 */

#if (XCP_PL_CAL == (XCP_PL_CAL&XCP_RESOURCE))
/*PAG Related*/
#define XCP_MAX_SEGMENT             1u
#define XCP_PAG_SUPPORT             STD_OFF
    #if (XCP_PAG_SUPPORT == STD_ON)
    /* Num of Page define */
    #define XCP_RAM_PAGE_NUM            0u
    #define XCP_FLASH_PAGE_NUM          1u
    #define XCP_MMU_SUPPORT             STD_OFF
    #if (XCP_MMU_SUPPORT == STD_ON)
    #define XCP_TLB_ENTRY_NUM           2u  /*< (2*XCP_MAX_SEGMENT) */
    #define XCP_RAM_PAGE_PID            1
    #define XCP_FLASH_PAGE_PID          2
    #endif
    #endif


#define Xcp_PageBuffer0_Size 0x1000u  

#endif /* (XCP_PL_DAQ == (XCP_PL_DAQ&XCP_RESOURCE)) */

/* 
 * DAQ/STIM Related 
 */
#if (XCP_PL_DAQ == (XCP_PL_DAQ&XCP_RESOURCE))
/* DAQ Format */
#define XCP_DAQ_CONFIG_TYPE             XCP_DAQ_STATIC
#define XCP_IDENTIFICATION_FIELD_TYPE   XCP_PID_RELATIVE_BYTE
#define XCP_PID_OFF_SUPPORT             STD_OFF
/* TimeStamp */
#define XCP_TIMESTAMP_TYPE          XCP_TS_NO_TS
#if (XCP_TIMESTAMP_TYPE != XCP_TS_NO_TS)
#define XCP_TIMESTAMP_FIXED          STD_OFF
#define XCP_TIMESTAMP_TICKS         100u
#define XCP_TIMESTAMP_UNIT          XCP_TIME_UNIT_10US
#define XCP_TS_CNT_ID               0x0
#endif /* (XCP_TIMESTAMP_TYPE != XCP_TS_NO_TS) */

/* optional function */
#define XCP_PRESCALER_SUPPORTED		    STD_ON
#define XCP_DAQ_PRIORITY_SUPPORT        STD_ON
#define XCP_DAQ_OVERLOAD_INDICATION     XCP_DAQ_OVERLOAD_NO_INDIC

/* DAQ Num limitation */
#define XCP_MIN_DAQ					0u
#if (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_DYNAMIC)
#define XCP_DAQ_COUNT               3u
#define XCP_DYNAMIC_DAQ_BUFFER_SIZE	2048u

#endif /* (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_DYNAMIC) */
#if (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_DYNAMIC)
#define XCP_MAX_DAQ                 3u/*(XCP_MIN_DAQ + XCP_DAQ_COUNT)*/
#else /* XCP_DAQ_CONFIG_TYPE == XCP_DAQ_STATIC */
#define XCP_MAX_DAQ                 3u              
#endif /* (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_DYNAMIC) */
#define XCP_ODT_ENTRY_SIZE_STIM     8u
#define XCP_ODT_ENTRY_SIZE_DAQ      8u

/* Event Channel */
#define EventChannel_0       0u 
#define EventChannel_1       1u 
#define EventChannel_2       2u 

#define XCP_MAX_EVENT_CHANNEL       3u

#define XCP_EVCHBUFFER_0_DEPTH       1u 
#define XCP_EVCHBUFFER_1_DEPTH       1u 
#define XCP_EVCHBUFFER_2_DEPTH       1u 

#define XCP_EVCH_0_DAQNUM       3u 
#define XCP_EVCH_1_DAQNUM       3u 
#define XCP_EVCH_2_DAQNUM       3u 

#endif /* (XCP_PL_DAQ == (XCP_PL_DAQ&XCP_RESOURCE)) */

/* 
 * PGM Related
 */
#if (XCP_PL_PGM == (XCP_PL_PGM & XCP_RESOURCE))

/* fill the gaps of flash */
#define XCP_PGM_FILLER      0xffu  /* fixed*/

/* falsh retry number */
#define XCP_PGM_REQRETRIE   0x03u  /* fixed */

/*Xcp Total Sector used in GET_PGM_PROCESSOR_INFO & GET_SECTOR_INFO command */
#define XCP_MAX_SECTOR      0x1u  /* fixed */

#define XCP_CLEAR_AND_PROGRAM_SEQUENCE_CHECK  STD_OFF  

#endif

/* 
 * Optional Command Enable 
 */
/* STD */
#define XCP_GET_COMM_MODE_INFO              STD_ON    /*  */
#define XCP_GET_ID                          STD_ON    /*  */
#if (XCP_GET_ID == STD_ON)
#define XCP_NUM_OF_ID                       0x1u/*ID????*/
#endif /* (XCP_GET_ID == STD_ON) */
#define XCP_SET_REQUEST			            STD_OFF   /* temporarity not supported */
#define XCP_SEED_AND_UNLOCK                 STD_ON    /* get seed&unlock Command shall be enable in pairs */
#define XCP_SET_MTA		                    STD_ON    /* shall be supported if upload/download ect. is enabled */
#define XCP_UPLOAD                          STD_ON    /*  */
#define XCP_UPLOAD_FLOATING_DATA_SUPPORT    STD_ON    /*  */
	
#define XCP_SHORT_UPLOAD                    STD_ON    /*  */
#define XCP_BUILD_CHECKSUM                  STD_ON    /*  */
#if (XCP_BUILD_CHECKSUM == STD_ON)
#define XCP_MAX_CHECKSUM_SIZE               0x100u
#endif /* (XCP_BUILD_CHECKSUM == STD_ON) */
#define XCP_TRANSPORT_LAYER_CMD             STD_ON    /*  */
#if (XCP_ON_CAN_ENABLE == STD_ON)
#define	XCP_GET_SLAVE_ID                    STD_ON    /* Required by AUTOSAR */
#define	XCP_GET_DAQ_ID                      STD_ON   /*  */
#define	XCP_SET_DAQ_ID                      STD_OFF   /* No suitable API provided by AUTOSAR */
#endif
#define XCP_USER_CMD                        STD_OFF   /* User defined Command temp. out of scope */

/* CAL */
#if (XCP_PL_CAL == (XCP_PL_CAL & XCP_RESOURCE))
#define XCP_DOWNLOAD_NEXT		            XCP_MASTER_BLOCK_MODE    /* if MASTER_BLOCK is enable this command shall be supported */
#define XCP_DOWNLOAD_MAX                    STD_OFF
#define XCP_SHORT_DOWNLOAD	                STD_OFF   /* Not Supported on CAN */
#define XCP_MODIFY_BITS                     STD_OFF
/* PAG */
#if (XCP_PAG_SUPPORT == STD_ON)
#define XCP_SET_CAL_PAGE                    XCP_PAG_SUPPORT
#define XCP_GET_CAL_PAGE                    XCP_PAG_SUPPORT
#define XCP_GET_PAG_PROCESSOR_INFO          STD_OFF
#define XCP_GET_SEGMENT_INFO                STD_OFF
#define XCP_GET_PAGE_INFO                   STD_OFF
#define XCP_SET_SEGMENT_MODE	            STD_OFF
#define XCP_GET_SEGMENT_MODE                STD_OFF
#define XCP_COPY_CAL_PAGE                   STD_OFF
#endif /* (XCP_PAG_SUPPORT == STD_ON) */
#endif /* (XCP_PL_CAL == (XCP_PL_CAL & XCP_RESOURCE)) */

#if (XCP_PL_DAQ == (XCP_PL_DAQ & XCP_RESOURCE))
#define XCP_WRITE_DAQ_MULTIPLE              STD_OFF   /* Not Supported on CAN */
#define XCP_READ_DAQ                        STD_OFF
#define XCP_GET_DAQ_CLOCK                   STD_OFF   /* if no timestamp this command shall be disable */
#define XCP_GET_DAQ_PROCESSOR_INFO          STD_ON
#define XCP_GET_DAQ_RESOLUTION_INFO         STD_ON
#define XCP_GET_DAQ_LIST_MODE               STD_ON
#define XCP_GET_DAQ_EVENT_INFO              STD_ON
#if (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_STATIC)
#define XCP_GET_DAQ_LIST_INFO               STD_OFF
#endif /* (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_STATIC) */

#endif  /* end of  (XCP_PL_DAQ == (XCP_PL_DAQ & XCP_RESOURCE))*/

#if (XCP_PL_PGM == (XCP_PL_PGM & XCP_RESOURCE))
#define XCP_PROGRAM_NEXT                    XCP_MASTER_BLOCK_MODE
#define XCP_GET_SECTOR_INFO                 STD_OFF
#define XCP_GET_PGM_PROCESSOR_INFO          STD_ON
#define XCP_PROGRAM_PREPARE                 STD_OFF   /* Not supported yet */
#define XCP_PROGRAM_FORMAT                  STD_OFF    /* for now only access mode can be changed */
#define XCP_PROGRAM_MAX                     STD_OFF
#define XCP_PROGRAM_VERIFY                  STD_OFF   /* Not supported yet */
#endif
/*
 * End of Optional Command
 */

/*=======[T Y P E   D E F I N I T I O N S]====================================*/
#if (XCP_TIMESTAMP_TYPE == XCP_TS_ONE_BYTE)
typedef VAR(uint8,TYPEDEF)   Xcp_TSType;
#elif (XCP_TIMESTAMP_TYPE == XCP_TS_TWO_BYTE)
typedef VAR(uint16,TYPEDEF)   Xcp_TSType;
#elif (XCP_TIMESTAMP_TYPE == XCP_TS_FOUR_BYTE)
typedef VAR(uint32,TYPEDEF)   Xcp_TSType;
#endif

#if (XCP_IDENTIFICATION_FIELD_TYPE == XCP_PID_ABSOLUTE) || (XCP_IDENTIFICATION_FIELD_TYPE == XCP_PID_RELATIVE_BYTE)
typedef VAR(uint8,TYPEDEF)     Xcp_DaqNumType;
#else
typedef VAR(uint16,TYPEDEF)    Xcp_DaqNumType;
#endif

/* typedef according to the [AG] */
#if (XCP_ADDRESS_GRANULARITY==XCP_AG_BYTE)
typedef VAR(uint8,TYPEDEF)   Xcp_AGType;
#elif (XCP_ADDRESS_GRANULARITY==XCP_AG_WORD)
typedef VAR(uint16,TYPEDEF)  Xcp_AGType;
#elif (XCP_ADDRESS_GRANULARITY==XCP_AG_DWORD)
typedef VAR(uint32,TYPEDEF)  Xcp_AGType;  
#endif

typedef struct
{
    uint8 type;
    uint8 mode;
    uint32 length;
    P2CONST(uint8, TYPEDEF, XCP_CONST_PBCFG) ptr;
}Xcp_IdInfoType;

typedef struct
{
    uint8   Xcp_MaxCto;
    #if (XCP_PL_PGM == (XCP_RESOURCE&XCP_PL_PGM))
    uint8   Xcp_MaxCtoPgm;
    #endif
    uint16  Xcp_MaxDto;
    #if (XCP_INTERLEAVED_MODE == STD_ON)
    uint8   Xcp_QueueSize;
    #endif
    #if (XCP_MASTER_BLOCK_MODE == STD_ON)
    uint8   Xcp_MaxBs;
    uint8   Xcp_MinSt;
        #if (XCP_PL_PGM == (XCP_RESOURCE&XCP_PL_PGM))
        uint8   Xcp_MaxBsPgm;
        uint8   Xcp_MinStPgm;
        #endif
    #endif
    #if (XCP_BUILD_CHECKSUM == STD_ON)
    uint32  Xcp_ChksumMaxSize;
    #endif
    #if (XCP_GET_ID == STD_ON)
    uint8   Xcp_IdInfoNum;
    P2CONST(Xcp_IdInfoType, TYPEDEF, XCP_CONST_PBCFG)
            Xcp_IdInfoPtr;
    #endif

    #if (XCP_PL_DAQ == (XCP_PL_DAQ & XCP_RESOURCE))
    uint16   Xcp_MaxEventChannel;
    
	uint8  Xcp_MinDaq;
    Xcp_DaqNumType  Xcp_MaxDaq;

    #if (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_DYNAMIC)
    uint16 Xcp_DaqCount;
    #endif
    uint8   Xcp_OdtEntrySizeStim;
    uint8   Xcp_OdtEntrySizeDaq;
    #if (XCP_TIMESTAMP_TYPE != XCP_TS_NO_TS)
    CounterType Xcp_timeStampCounterID;
    #endif
    #endif
    uint8   Xcp_TransmitTimeoutValve;
}Xcp_GernalType;


#if (XCP_PL_DAQ == (XCP_PL_DAQ & XCP_RESOURCE))
typedef struct
{
    uint8 XcpOdtEntryLength;
	P2VAR(Xcp_AGType, TYPEDEF, XCP_VAR)XcpOdtEntryAddress;
}Xcp_EntryType;

typedef struct
{
    uint8 			XcpOdtListSize;
	P2VAR(Xcp_EntryType, TYPEDEF, XCP_VAR)XcpOdtEntry;
}Xcp_OdtType;

typedef struct
{
    #if (XCP_DAQ_CONFIG_TYPE == XCP_DAQ_STATIC)
    uint8      XcpMaxOdt;
    uint8      XcpMaxOdtEntries;
    #else
    uint8      XcpDaqSize;
    #endif
    #if (XCP_IDENTIFICATION_FIELD_TYPE == XCP_PID_ABSOLUTE)
    uint8      XcpFirstPid;
    #endif
    Xcp_DaqDirectionType    XcpDaqListtype;
    uint16     XcpDaqListNumber;
    P2CONST(Xcp_TxPduType, TYPEDEF, XCP_CONST_PBCFG)
                            XcpDaqTxPduRef;
    P2CONST(Xcp_RxPduType, TYPEDEF, XCP_CONST_PBCFG)
                            XcpDaqRxPduRef;
    P2VAR(Xcp_OdtType, TYPEDEF, XCP_CONST_PBCFG)
                            XcpOdt;
}Xcp_DaqListConfigType;


typedef struct
{
    P2CONST(uint8, TYPEDEF, XCP_CONST_PBCFG) EventChannelNamePtr;
    uint8                       EventChannelNameLength;
    uint8                       XcpEventChannelMaxDaqList;
    uint8                       XcpEventChannelPriority;
    uint8                       XcpEventChannelTimeCycle;
    Xcp_TimeUintType            XcpEvemtChannelTimeUnit;
    Xcp_EventChannelConsistType XcpEventChannelConsistency;
    Xcp_DaqDirectionType        XcpEventChannelType;
    uint16     					XcpEventChannelNumber;
    Xcp_DaqNumType              XcpEvChTriggeredDaqListNum;
    uint32                      Xcp_EvChBuffDpth;
    P2VAR(Xcp_AGType, TYPEDEF, XCP_CONST_PBCFG)
                                Xcp_EvChBuffPtr;
    P2CONST(Xcp_DaqNumType, TYPEDEF, XCP_CONST_PBCFG)
                                XcpEvChTriggeredDaqListRef;
}Xcp_EventChannelConfigType;

#endif  /* end of (XCP_PL_DAQ&XCP_RESOURCE == XCP_PL_DAQ) */

typedef struct
{
    P2CONST(Xcp_TxPduType, TYPEDEF, XCP_CONST_PBCFG) XcpCtoTxPduRef;
    P2CONST(Xcp_RxPduType, TYPEDEF, XCP_CONST_PBCFG) XcpCtoRxPduRef;
    P2CONST(Xcp_GernalType, TYPEDEF, XCP_CONST_PBCFG) XcpGernalRef;
    #if (XCP_PL_DAQ == (XCP_PL_DAQ&XCP_RESOURCE))
    P2CONST(Xcp_DaqListConfigType, TYPEDEF, XCP_CONST_PBCFG) XcpDaqList;
    P2CONST(Xcp_EventChannelConfigType, TYPEDEF, XCP_CONST_PBCFG) XcpEventChannel;
    #endif
}Xcp_ConfigType;

#if (XCP_PL_CAL == (XCP_PL_CAL&XCP_RESOURCE))
typedef struct
{
    uint32 size;
    uint32 ramStart;
    uint32 ramEnd;
    uint32 romStart;
    uint32 romEnd;
    #if (XCP_PAG_SUPPORT == STD_ON)
    #if (XCP_MMU_SUPPORT == STD_ON)
    uint32 dummyRamStart;
    uint32 dummyRamEnd;
    #else
    uint32 bufferPtr;
    #endif
    #endif
}Xcp_PageInfoType;
#endif

typedef struct
{
    #if (XCP_PL_CAL == (XCP_PL_CAL&XCP_RESOURCE))
    uint8 maxSegNum;
    #endif
    uint32 measurementRomStart;	//new
    uint32 measurementRomEnd;	//new
    uint32 measurementRamStart;	//new
    uint32 measurementRamEnd;	//new
    #if (XCP_PL_CAL == (XCP_PL_CAL&XCP_RESOURCE))
    P2CONST(Xcp_PageInfoType, AUTOMATIC, XCP_CONST_PBCFG) pageInfoPtr;
    #if (XCP_PAG_SUPPORT == STD_ON)
    #if (XCP_MMU_SUPPORT == STD_ON)
    uint32 maxTlbNum;
    P2CONST(Xcp_TLBInfoType, TYPEDEF, XCP_CONST_PBCFG) tlbInfoPtr;
    #endif
    #endif
    #endif
}Xcp_SegmentInfoType;

#if (XCP_PL_PGM == (XCP_PL_PGM&XCP_RESOURCE))
/* Xcp program_clear type in functional access mode */
typedef enum 
{
	XCP_FLASH_RANGE_CAL = 0x01u,
	XCP_FLASH_RANGE_CODE = 0x02u,
	XCP_FLASH_RANGE_NVRAM = 0x04u
}Xcp_FlashAearType;

/* xcp sector information,used in GET_SECTOR_INFO command */
typedef struct
{
    P2CONST(uint8, TYPEDEF, XCP_CONST_PBCFG) sectorNamePtr;      /**< SECTOR_NAME */
    uint8   sectorNameLength;   /**< SECTOR_NAME length */
    uint8   sectorNo;           /**< SECTOR_NUMBER */ 
    uint32  sectorStartAddress; /**< Address */
    uint32  sectorLength;       /**< Length  */ 
    VAR(Xcp_FlashAearType, TYPEDEF) rangeType; /**< flash range type */
    uint32  progStartAddress;   /**< Program Start Address */ 
    uint32  progDataSize;       /**< Program Data Size */ 
    uint8   sectorClearSequenceNo;  /**< CLEAR_SEQUENCE_NUMBER */ 
    uint8   sectorPgmSequenceNo;    /**< PROGRAM_SEQUENCE_NUMBER */
    uint8   sectorPgmMethod;        /**< PROGRAM_METHOD */ 
}Xcp_SectorInfoType;
#endif

/*=======[E X T E R N A L   D A T A]==========================================*/
extern CONST(Xcp_ConfigType,XCP_CONST_PBCFG) XcpConfig;

extern CONST(Xcp_SegmentInfoType,XCP_CONST_PBCFG) Xcp_SegmentInfo;

#if (XCP_PL_PGM == (XCP_PL_PGM&XCP_RESOURCE))
extern CONST(Xcp_SectorInfoType,XCP_CONST_PBCFG) Xcp_SectorInfo[XCP_MAX_SECTOR];
#endif

#endif  /* endof XCP_CFG_H */

/*=======[E N D   O F   F I L E]==============================================*/
